﻿<phone:PhoneApplicationPage x:Class="MijnMultiOSRSSApp.WP71.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                            xmlns:t="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns:h="clr-namespace:MijnMultiOSRSSApp.Helpers"
                            xmlns:appbarutils="clr-namespace:AppBarUtils;assembly=AppBarUtils"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="768"
                            d:DataContext="{d:DesignData /SampleData/MainViewModelSampleData.xaml}"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            t:TiltEffect.IsTiltEnabled="True">

    <shell:SystemTray.ProgressIndicator>
        <shell:ProgressIndicator IsIndeterminate="{Binding IsDataLoaded, Converter={StaticResource BooleanNegationConverter}}"
                                 IsVisible="{Binding IsDataLoaded, Converter={StaticResource BooleanNegationConverter}}"
                                 Text="{Binding LocalizedResources.LoadingItems, Source={StaticResource LocalizedStrings}}" />
    </shell:SystemTray.ProgressIndicator>

    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot"
          Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0"
                    Margin="12,17,0,28">
            <TextBlock Text="{Binding Title, Source={StaticResource Assembly}, Converter={StaticResource StringCaseConverter}, ConverterParameter=u}"
                       Style="{StaticResource PhoneTextNormalStyle}" />
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel"
              Grid.Row="1"
              Margin="12,0">
            <TextBlock Text="{Binding LocalizedResources.ErrorMessage, Source={StaticResource LocalizedStrings}}"
                       Style="{StaticResource PhoneTextLargeStyle}"
                       TextWrapping="Wrap"
                       Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToVisibilityConverter}}" />

            <!--Panorama control-->
            <controls:Panorama FontFamily="Portable User Interface">
                <controls:Panorama.Background>
                    <ImageBrush ImageSource="/Assets/Achtergrond.png"
                                Opacity="0.6"
                                Stretch="UniformToFill" />
                </controls:Panorama.Background>

                <!--Panorama item 1-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle5, Source={StaticResource Configuration}}"
                                       Margin="0"
                                       Padding="0"
                                       UseLayoutRounding="True">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox5"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items5}"
                             SelectionChanged="FeedListBox5_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Source="/Assets/Logo.png"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Column="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 2-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle1, Source={StaticResource Configuration}}"
                                       Margin="0"
                                       Padding="0"
                                       UseLayoutRounding="True">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox1"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items1}"
                             SelectionChanged="FeedListBox1_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Source="/Assets/Logo.png"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Column="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 3-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle2, Source={StaticResource Configuration}}"
                                       Margin="0">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox2"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items2}"
                             SelectionChanged="FeedListBox2_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Source="/Assets/Logo.png"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Column="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 4-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle3, Source={StaticResource Configuration}}"
                                       Margin="0">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox3"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items3}"
                             SelectionChanged="FeedListBox3_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Source="/Assets/Logo.png"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Column="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 5-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle4, Source={StaticResource Configuration}}">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox4"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items4}"
                             SelectionChanged="FeedListBox4_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Source="/Assets/Logo.png"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Column="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 6-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle6, Source={StaticResource Configuration}}">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox6"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items6}"
                             SelectionChanged="FeedListBox6_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Image Source="/Assets/Logo.png"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="110"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Column="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 7-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle7, Source={StaticResource Configuration}}">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox7"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items7}"
                             SelectionChanged="FeedListBox7_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="Auto"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Row="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 8-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle8, Source={StaticResource Configuration}}">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox8"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items8}"
                             SelectionChanged="FeedListBox8_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="Auto"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Row="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 9-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle9, Source={StaticResource Configuration}}">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox9"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items9}"
                             SelectionChanged="FeedListBox9_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="Auto"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Row="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>

                <!--Panorama item 10-->
                <controls:PanoramaItem Header="{Binding Config.FeedTitle10, Source={StaticResource Configuration}}">
                    <controls:PanoramaItem.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                       FontSize="50" />
                        </DataTemplate>
                    </controls:PanoramaItem.HeaderTemplate>

                    <ListBox x:Name="FeedListBox10"
                             Margin="0,0,0,0"
                             ItemsSource="{Binding Items10}"
                             SelectionChanged="FeedListBox10_SelectionChanged"
                             Visibility="{Binding HasErrorOccurred, Converter={StaticResource BooleanToInverseVisibilityConverter}}">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Margin="12,0,0,17">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Image Source="{Binding ., Converter={StaticResource SyndicationToImageConverter}}"
                                           Width="Auto"
                                           VerticalAlignment="Top"
                                           Stretch="UniformToFill"
                                           Margin="0,12,0,0" />
                                    <StackPanel Grid.Row="1">
                                        <TextBlock Text="{Binding Title, Converter={StaticResource StripHtmlConverter}}"
                                                   TextWrapping="Wrap"
                                                   Style="{StaticResource PhoneTextLargeStyle}" />
                                    </StackPanel>
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </controls:PanoramaItem>
            </controls:Panorama>
        </Grid>
    </Grid>

    <!-- Application Bar -->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True"
                              IsMenuEnabled="True"
                              Mode="Default">
            <!--<shell:ApplicationBarIconButton IconUri="/Resources/Icons/feature.settings.png" Text="settingsId"/>-->
            <shell:ApplicationBarIconButton IconUri="/Resources/Icons/sync.png"
                                            Text="refreshId" />
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="aboutId" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <!-- Application Bar Interaction -->
    <i:Interaction.Behaviors>
        <!--<appbarutils:AppBarItemCommand Id="settingsId" Command="{Binding Settings}"/>-->
        <appbarutils:AppBarItemCommand Id="refreshId"
                                       Command="{Binding Refresh}" />
        <appbarutils:AppBarItemCommand Type="MenuItem"
                                       Id="aboutId"
                                       Command="{Binding About}" />
    </i:Interaction.Behaviors>
    <i:Interaction.Triggers>
        <!--<appbarutils:AppBarItemTrigger Id="settingsId" Text="{Binding LocalizedResources.Settings, Source={StaticResource LocalizedStrings}}" />-->
        <appbarutils:AppBarItemTrigger Id="refreshId"
                                       Text="{Binding LocalizedResources.Refresh, Source={StaticResource LocalizedStrings}}" />
        <appbarutils:AppBarItemTrigger Type="MenuItem"
                                       Id="aboutId"
                                       Text="{Binding LocalizedResources.About, Source={StaticResource LocalizedStrings}}" />
    </i:Interaction.Triggers>

</phone:PhoneApplicationPage>